import { Base } from '../../utils/base.js';
class Subscribe extends Base {
  //构造方法-调用调用父级方法-》super()
  constructor() {
    super();
  }

  //预约信息插入
  setSubscribe(param, callback) {
    var that = this;
    // console.log(param);
    var allParams = {
      url: 'subscribe',
      type: 'post',
      data: param,
      header: {
        'content-type': 'application/x-www-form-urlencoded',
       
        },
      sCallback: function (data) {
        // that.execSetStorageSync(true);
        callback && callback(data);
      },
      eCallback: function () {
      }
    };
    this.request(allParams);
  }

  //单人单商品预约信息查询
  getSubscribe(id,callback){
    var that = this;
    // console.log(wx.getStorageSync('token'));
    var param={
      url:'catSubscribe/'+id,
      header: {
        'content-type': 'application/json',
        
        },
      sCallback: function (data) {
        callback && callback(data);
      }
      
    };
    this.request(param);
    
  };

   //单人预约信息查询
  getSubscribeAll(callback){
    var that = this;
 
    var param={
      url:'selSubscribe',
      header:{
        'content-type': 'application/json',
        },
      sCallback: function (data) {
        callback && callback(data);
      }
      
    };
    this.request(param);
    
  };
}

export {Subscribe}